﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;
using Bundled.Entity;

namespace Bundled.Pages.Contact
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnContactSend_Click(object sender, EventArgs e)
        {
            string smtpServer = "";

            MailMessage mail = new MailMessage();
            mail.To.Add("leberjs@gmail.com");
            mail.From = new MailAddress(Utility.SanitizeText(txtContactEmail.Text));
            mail.Subject = ddlSubject.SelectedValue;
            mail.Body = Utility.SanitizeText(txtaContactMessage.Value);

            smtpServer = System.Web.Configuration.WebConfigurationManager.AppSettings["smtp"];
            SmtpClient mSmtpClient = new SmtpClient(smtpServer);
            mSmtpClient.Send(mail);
        }
    }
}